/**
 * 通过path、parent找到所有同支祖孙路由
 * @param {Object} route
 * @param {String} path
 */
export default function createMatchRoute(route, path) {
  const matched = [];
  while (route) {
    matched.unshift(route);
    route = route.parent;
  }

  return {
    path,
    matched
  };
}
